package com.zcxx.controller;

import com.zcxx.common.Result;
import com.zcxx.model.User;
import com.zcxx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/auth")
public class AuthController {

    @Autowired
    private UserService userService;

    /**
     * 用户注册
     *
     * @param user 用户信息（通过请求体传递）
     * @return 返回操作结果的 Result 对象
     */
    @PostMapping("/register")
    public Result<String> register(@RequestBody User user) {
        return Result.success(userService.register(user));
    }

}
